<%@ page language="java" pageEncoding="utf-8"%>
<%@page import="com.witframework.core.ApplicationContextFactory"%>
<%@page import="com.witframework.core.logic.IBaseService"%>
<%@ include file="/basecore/taglibs.jsp"%>
<%@ taglib prefix="tab" uri="http://ditchnet.org/jsp-tabs-taglib"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title></title>
		<%@ include file="/basecore/meta.jsp"%>	
		<script
			src="${contextPath}/webresource/components/codepress/codepress.js"
			type="text/javascript"></script>
		<tab:tabConfig />
	</head>
	<body>
		<div class="page-navigate">
			&nbsp;
			<img src="${contextPath}/webresource/images/app.png">
			<span> 系统组件- 树形数据选择TAG </span>
		</div>
		<tab:tabContainer id="foo-bar-container">
			<tab:tabPane id="base0" tabTitle="用法">
			</tab:tabPane>
			<tab:tabPane id="base1" tabTitle="例子1">
				<textarea id="selectinput" style="width: 700px; height: 80px;"
					wrap="on">
	&lt;ws:tree name="demoTree" treeBox="demoTreeBox" rootId="-1"
	theme="csh_winstyle" childAction="/baseapplication/treeController.wit"
	/&gt;
	</textarea>
				<div id="demoTreeBox" style="width: 400"></div>
				<wit:tree name="demoTree" treeBox="demoTreeBox" rootId="-1"
					theme="csh_winstyle"
					childAction="/baseapplication/treeController.wit"
					onClickHandler="doOnClick" />
			</tab:tabPane>

			<tab:tabPane id="base2" tabTitle="例子2">
				<textarea id="selectinput2" style="width: 700px; height: 100px;"
					wrap="on">
	&lt;wit:tree name="demoTree" treeBox="demoTreeBox" rootId="0"
	theme="csh_winstyle" childAction="/baseapplication/treeController.wit"
	onClickHandler="doOnClick" /&gt;
</textarea>
				<br>
				<script>
function getAllChecked(){
	var list=demoTree2.getAllChecked();
}
function testHandler(){
	alert("handler");
}
function doOnClick(nodeId) {    
    alert("onclick:"+nodeId);
}
function onNodeSelect(nodeId){
	alert(nodeId);
}
function getUserData() {
    var id = demoTree2.getSelectedItemId();
    var da = demoTree2.getUserData(id, "data");
    return da;
}
function hasChildren(){
	var id = demoTree2.getSelectedItemId();
	return demoTree2.hasChildren(id);
}
function getSelectedItemId() {
    return demoTree2.getSelectedItemId();
}
function getSelectedItemText() {
    return demoTree2.getSelectedItemText();
}
function test(){
	demoTree2.enableTreeLines(true);
	demoTree2.enableMultiLineItems(true);
	demoTree2.enableKeyboardNavigation(true);
	demoTree2.enableSmartXMLParsing(true);//false to disable
	demoTree2.enableThreeStateCheckboxes(true)//false to disable
}
</script>
选择树演示
<table>
					<tr>
						<td>
							<div id="demoTreeBox2" style="width: 400"></div>
							<wit:tree name="demoTree2" treeBox="demoTreeBox2" rootId="0"
								theme="csh_winstyle"
								childAction="/baseapplication/treeController.wit"
								onClickHandler="doOnClick" />
							<script>
</script>
						<td></td>
						<td align=left valign="top">
							<input type="button" onclick="alert(demoTree2.getAllChecked());"
								value="getAllChecked">
							<input type="button" onclick="alert(getSelectedItemText());"
								value="getSelectedItemText">
							<input type="button" onclick="alert(getSelectedItemId());"
								value="getSelectedItemId">
							<input type="button" onclick="alert(hasChildren());"
								value="hasChildren">
							<input type="button" onclick="alert(getUserData());"
								value="getUserData">
						</td>
					</tr>
				</table>
			</tab:tabPane>
		</tab:tabContainer>

	</body>
</html>
